#include<iostream>
using namespace std;
int n;
char g[6][50];
int main()
{
	cin >> n;
	for (int i = 0; i <	5; i++) {
		for (int j = 0; j < n * 4; j++) {
			cin >> g[i][j];
		}
	}
	for (int i = 0; i < n * 4; ) {
		if (g[3][i] == '*')cout << "2";
		else if (g[3][i + 1] == '*')cout << "1";
		else cout << "3";
		i += 4;
	}
	return 0;
}